package br.com.localfloripa.converters;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

import org.springframework.stereotype.Component;

@Component("colorConverter")
public class ColorPickerConverter implements Converter {

	@Override
	public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) {  		
		return submittedValue; //just return the rgb value as string  
	}  
  
	@Override
	public String getAsString(FacesContext facesContext, UIComponent component, Object value) {  
	    if (value == null)  
	        return null;  
	    else{  
	       return value.toString();
	    }  
	}  

}
